--	Package File Template
--
--	Purpose: This package defines supplemental types, subtypes, 
--		 constants, and functions 


library IEEE;
use IEEE.STD_LOGIC_1164.all;

package definitions is

  type state_type is (FETCH,DECODE,INT,EXECUTE,MEM,WRITEBACK);
  
  -- Constantes extensiones ALU registro 
  constant add_opcode: STD_LOGIC_VECTOR (2 downto 0):= "000";
  constant addc_opcode: STD_LOGIC_VECTOR (2 downto 0):= "001";
  constant sub_opcode: STD_LOGIC_VECTOR (2 downto 0):= "010";
  constant subc_opcode: STD_LOGIC_VECTOR (2 downto 0):= "011";
  constant and_opcode: STD_LOGIC_VECTOR (2 downto 0):= "100";
  constant or_opcode: STD_LOGIC_VECTOR (2 downto 0):= "101";
  constant xor_opcode: STD_LOGIC_VECTOR (2 downto 0):= "110";
  
  -- Constantes extensiones de Desplazamiento
  constant sll_opcode: STD_LOGIC_VECTOR (2 downto 0):= "000";
  constant srl_opcode: STD_LOGIC_VECTOR (2 downto 0):= "001";
  constant sla_opcode: STD_LOGIC_VECTOR (2 downto 0):= "010";
  constant sra_opcode: STD_LOGIC_VECTOR (2 downto 0):= "011";
  constant rol_opcode: STD_LOGIC_VECTOR (2 downto 0):= "100";
  constant ror_opcode: STD_LOGIC_VECTOR (2 downto 0):= "101";
  
  -- Constantes extensiones Saltos Condicionales
  constant bz_opcode: STD_LOGIC_VECTOR (1 downto 0):= "00";
  constant bnz_opcode: STD_LOGIC_VECTOR (1 downto 0):= "01";
  constant bc_opcode: STD_LOGIC_VECTOR (1 downto 0):= "10";
  constant bnc_opcode: STD_LOGIC_VECTOR (1 downto 0):= "11";

  -- Constante de Saltos Incondicionales
  constant jmp_opcode: STD_LOGIC_VECTOR (1 downto 0):= "00";
  constant call_opcode: STD_LOGIC_VECTOR (1 downto 0):= "01";
  
  -- Constantes extensiones de Miscelanea
  constant ret_opcode: STD_LOGIC_VECTOR (2 downto 0):= "000";
  constant reti_opcode: STD_LOGIC_VECTOR (2 downto 0):= "001";
  constant eni_opcode: STD_LOGIC_VECTOR (2 downto 0):= "010";
  constant disi_opcode: STD_LOGIC_VECTOR (2 downto 0):= "011";
  constant wait_opcode: STD_LOGIC_VECTOR (2 downto 0):= "100";
  constant stdby_opcode: STD_LOGIC_VECTOR (2 downto 0):= "101";
  
end definitions;